<?php
	include_once("Login.php");
	
	$body = file_get_contents('php://input');
	$xml = simplexml_load_string($body);

	$conn = new mysqli($host,$user,$passwd, $database)
	or die("SQL connect error: ".mysqli_connect_error());
	
	$username = $xml->username;
	$query = "SELECT username FROM User WHERE Username='$username'";
	$result = mysqli_query($conn, $query);
	if(count(mysqli_fetch_array($result)) >= 1)
	{
		?>
			<node><loginMessage>
			success
			</loginMessage></node>
		<?php
	}else{
		?>
			<node><loginMessage>
			failure
			</loginMessage></node>
		<?php
	}
	mysqli_close($conn);
?>